<template>
  <el-config-provider :locale="language">
    <NuxtLayout>
      <NuxtPage/>
    </NuxtLayout>
  </el-config-provider>
</template>
<script setup lang="ts">
import zhCn from 'element-plus/dist/locale/zh-cn'
import En from 'element-plus/dist/locale/en'
const lang = useStore.lang()
const i18n = useI18n()
/**
 * 根据语言状态改变页面文字显示
 */
const language = computed(() => {
  const langKey = lang.value == 'zh-cn' ? zhCn : En
  i18n.setLocale(lang.value)
  return langKey
})
</script>

<style lang="scss">
</style>